import cartApi from '../../api/cart.api';

const state={
  data:[],
  submit:[]
};

const getters={
  order: (state: any) => {
    return state.data;
  },
  
  submit: (state: any) => {
    return state.submit;
  },
};

const actions={
  async getOrders({commit}:any,params: any={}){
    const data=await cartApi.getCarts(params);
    commit('setData', data);
  }
};

const mutations={
  setData(state: any, data: any){
    state.data = data;
  },

  setSubmit(state: any, data: any){
    state.submit=data;
  }
};

export default {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}